﻿
/*
Initialization of dictionaries
USER: wolborski
DATE: 08/20/2012us
*/

if not exists (select 1 from GameLevels)
begin
	INSERT INTO [GameLevels]
           ([Id]
		   ,[Name]
           ,[PercentageValue]
           ,[InsertUser]
           ,[InsertDate]           
           ,[Deleted])
     VALUES
           (1
		   ,'20%'
           ,20
           ,'wieslawo'
           ,GETDATE()          
           ,0)

	INSERT INTO [GameLevels]
           ([Id]
		   ,[Name]
           ,[PercentageValue]
           ,[InsertUser]
           ,[InsertDate]           
           ,[Deleted])
     VALUES
           (2
		   ,'10%'
           ,10
           ,'wieslawo'
           ,GETDATE()          
           ,0)

	INSERT INTO [GameLevels]
           ([Id]
		   ,[Name]
           ,[PercentageValue]
           ,[InsertUser]
           ,[InsertDate]           
           ,[Deleted])
     VALUES
           (3
		   ,'5%'
           ,5
           ,'wieslawo'
           ,GETDATE()          
           ,0)
end

if not exists (select 1 from [LodzOfficeRooms])
begin
	
	INSERT INTO [LodzOfficeRooms]
           ([Id]
		   ,[RoomName]
           ,[InsertUser]
           ,[InsertDate]          
           ,[Deleted])
     VALUES
           (1
		   ,'Custom'
           ,'wieslawo'
           ,GETDATE()      
           ,0)

	INSERT INTO [LodzOfficeRooms]
           ([Id]
		   ,[RoomName]
           ,[InsertUser]
           ,[InsertDate]          
           ,[Deleted])
     VALUES
           (2
		   ,'MDF'
           ,'wieslawo'
           ,GETDATE()      
           ,0)

	INSERT INTO [LodzOfficeRooms]
           ([Id]
		   ,[RoomName]
           ,[InsertUser]
           ,[InsertDate]          
           ,[Deleted])
     VALUES
           (3
		   ,'Rewards'
           ,'wieslawo'
           ,GETDATE()      
           ,0)

	INSERT INTO [LodzOfficeRooms]
           ([Id]
		   ,[RoomName]
           ,[InsertUser]
           ,[InsertDate]          
           ,[Deleted])
     VALUES
           (4
		   ,'Aneta'
           ,'wieslawo'
           ,GETDATE()      
           ,0)

	INSERT INTO [LodzOfficeRooms]
           ([Id]
		   ,[RoomName]
           ,[InsertUser]
           ,[InsertDate]          
           ,[Deleted])
     VALUES
           (5
		   ,'Gosia'
           ,'wieslawo'
           ,GETDATE()      
           ,0)
end

if not exists (select 1 from Players)
begin
	
INSERT INTO [Players]([id],[Login],[Picture],[LodzOfficeRoomId],[AccountPoints],[InsertUser],[InsertDate],[Deleted])
VALUES (1,'HAWKEYEWW\wolborski',null,1,100,'wieslawo',GETDATE(),0)	

INSERT INTO [Players]([id],[Login],[Picture],[LodzOfficeRoomId],[AccountPoints],[InsertUser],[InsertDate],[Deleted])
VALUES (2,'HAWKEYEWW\kjozwiak',null,1,100,'wieslawo',GETDATE(),0)	

INSERT INTO [Players]([id],[Login],[Picture],[LodzOfficeRoomId],[AccountPoints],[InsertUser],[InsertDate],[Deleted])
VALUES (3,'HAWKEYEWW\pmikulski',null,1,100,'wieslawo',GETDATE(),0)	

INSERT INTO [Players]([id],[Login],[Picture],[LodzOfficeRoomId],[AccountPoints],[InsertUser],[InsertDate],[Deleted])
VALUES (4,'HAWKEYEWW\pstopczyk',null,1,100,'wieslawo',GETDATE(),0)	

INSERT INTO [Players]([id],[Login],[Picture],[LodzOfficeRoomId],[AccountPoints],[InsertUser],[InsertDate],[Deleted])
VALUES (5,'HAWKEYEWW\wgucio',null,1,100,'wieslawo',GETDATE(),0)
	
INSERT INTO [Players]([id],[Login],[Picture],[LodzOfficeRoomId],[AccountPoints],[InsertUser],[InsertDate],[Deleted])
VALUES (6,'HAWKEYEWW\lduraj',null,1,100,'wieslawo',GETDATE(),0)

INSERT INTO [Players]([id],[Login],[Picture],[LodzOfficeRoomId],[AccountPoints],[InsertUser],[InsertDate],[Deleted])
VALUES (7,'HAWKEYEWW\lsieczkowski',null,1,100,'wieslawo',GETDATE(),0)

INSERT INTO [Players]([id],[Login],[Picture],[LodzOfficeRoomId],[AccountPoints],[InsertUser],[InsertDate],[Deleted])
VALUES (8,'HAWKEYEWW\mwosinsk',null,1,100,'wieslawo',GETDATE(),0)

INSERT INTO [FoosballEye].[dbo].[PlayerHistories]
           ([PlayerId]
           ,[Login]
           ,[Picture]
           ,[LodzOfficeRoomId]
           ,[AccountPoints]
           ,[InsertUser]
           ,[InsertDate]
           ,[UpdateUser]
           ,[UpdateDate]
           ,[HistoryInsertUser]
           ,[HIstoryInsertDate]
           ,[Deleted])
     SELECT 
	   [Id]
      ,[Login]
      ,[Picture]
      ,[LodzOfficeRoomId]
      ,[AccountPoints]      
      ,[InsertUser]
      ,[InsertDate]
      ,[UpdateUser]
      ,[UpdateDate]
      ,'wolborski'
      ,'2014-05-15'
      ,[Deleted]
  FROM [FoosballEye].[dbo].[Players]
  --where Id in (24,25,26,27)

end